package com.blog.blogservice.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blog.blogservice.app.service.UserService;
import com.blog.blogservice.domain.entity.UserEntity;
import com.blog.blogservice.infra.mapper.UserMapper;
import org.springframework.stereotype.Service;

/**
 * 用户表 (User)应用服务
 *
 * @author guanglin.ma
 * @since 2024-03-10 22:54:11
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> implements UserService {

    @Override
    public UserEntity selectUser(UserEntity userEntity) {
        QueryWrapper queryWrapper = new QueryWrapper<>().eq("name", userEntity.getName());
        userEntity = baseMapper.selectOne(queryWrapper);
        return userEntity;
    }
}

